extends PointLight2D


@export var fade_in_time: float = 0.5
@export var fade_out_time: float = 3.0
@export var target_energy: float = 5.0


func _ready() -> void:
	start_fade()
	

func start_fade():
	energy = 0.0
	
	var tween = create_tween()
	tween.tween_property(self, "energy", target_energy, fade_in_time).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_OUT)
	await tween.finished
	
	tween = create_tween()
	tween.tween_property(self, "energy", 0.0, fade_out_time).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
	await tween.finished
	
	queue_free()
